<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<h:body>

	<ui:composition template="WEB-INF/templates/common/common-layout.xhtml">

		<ui:define name="content">

			<h:form>
				<p:panel id="patientRegistrationPanel" header="Enquiries">

					<p:dataTable id="enquiriesTable" var="e"
						value="#{enquiry.enquiries}" paginator="true" rows="10"
						paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
						rowsPerPageTemplate="5,10,15">
						<f:facet name="header">  
        				    Recent Enquiries
        				</f:facet>

						<p:column sortBy="enquiryId" headerText="Enquiry Id">

							<p:commandLink
								actionListener="#{enquiry.viewEnquiry(e.enquiryId)}"
								ajax="false" action="viewEnquiry">
								<h:outputText value="#{e.enquiryId}" />
							</p:commandLink>

						</p:column>

						<p:column sortBy="enquiryDate" headerText="Enquiry Date">
							<h:outputText value="#{e.enquiryDate}">
								<f:convertDateTime pattern="dd-MMM-yyyy" />
							</h:outputText>
						</p:column>

						<p:column sortBy="partyName" headerText="Party Name">

							<p:commandLink
								actionListener="#{enquiry.viewEnquiry(e.enquiryId)}"
								ajax="false" action="viewEnquiry">
								<h:outputText value="#{e.partyName}" />
							</p:commandLink>

						</p:column>

						<p:column sortBy="bhk" headerText="BHK">
							<h:outputText value="#{e.bhk}" />
						</p:column>

						<p:column sortBy="mobileNumber" headerText="Mobile Number">
							<h:outputText value="#{e.mobileNumber}" />
						</p:column>

						<p:column sortBy="residencePhoneNumber"
							headerText="Residence Phone">
							<h:outputText value="#{e.residencePhoneNumber}" />
						</p:column>

						<p:column sortBy="officePhoneNumber" headerText="Office Phone">
							<h:outputText value="#{e.officePhoneNumber}" />
						</p:column>

						<p:column sortBy="email" headerText="email">
							<h:outputText value="#{e.email}" />
						</p:column>

						<p:column sortBy="comments" headerText="comments">
							<h:outputText value="#{e.comments}" />
						</p:column>
					</p:dataTable>

				</p:panel>
			</h:form>
		</ui:define>
	</ui:composition>

</h:body>

</html>